﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Daq.Tools.Utils
{
    public class BusinessException : Exception
    {
        /// <summary>
        /// 成功标识
        /// </summary>
        public bool Success { get; set; }

        /// <summary>
        /// 抛出自定义状态消息
        /// </summary>
        /// <param name="success">成功标识</param>
        /// <param name="message">消息</param>
        public BusinessException(bool success, string message) : base(message)
        {
            Success = success;
        }

        /// <summary>
        /// 抛出一个错误消息
        /// </summary>
        /// <param name="message">消息</param>
        public BusinessException(string message) : base(message)
        {
            Success = false;
        }
    }
}